<!DOCTYPE html>


<html lang="zh-CN">


<head>
  <meta charset="utf-8" />
    
  <meta name="description" content="welcome" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    使用gitee搭建自己的图床 |  ChenyyのBlog
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/dist/main.css">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">
  
<link rel="stylesheet" href="/css/custom.css">

  
  <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
  
  

  

</head>

</html>

<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-blog/使用gitee搭建自己的图床"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  使用gitee搭建自己的图床
</h1>
 

    </header>
     
    <div class="article-meta">
      <a href="/2021/06/18/blog/%E4%BD%BF%E7%94%A8gitee%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%9B%BE%E5%BA%8A/" class="article-date">
  <time datetime="2021-06-18T13:21:21.000Z" itemprop="datePublished">2021-06-18</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/blog/">blog</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">1.3k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">4 分钟</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <ul>
<li>单独使用Gitee</li>
<li>结合Picgo</li>
<li>其他图床工具</li>
</ul>
<span id="more"></span>

<h1 id="单独使用Gitee"><a href="#单独使用Gitee" class="headerlink" title="单独使用Gitee"></a>单独使用Gitee</h1><p> 最近发现自己博客中的图片全部消失,很苦恼.当时用的是七牛云,花好长时间弄好的,当时用的还是很顺畅的,但有一个坑,就是需要配置自定义域名(当时没有注意到这一点), CSDN博客专家的推荐下搭建图床的方式 – 使用github page搭建图床.</p>
<p>大体步骤如下:</p>
<h2 id="1-创建gitee-码云-账号"><a href="#1-创建gitee-码云-账号" class="headerlink" title="1.创建gitee(码云)账号"></a>1.创建gitee(码云)账号</h2><p>1.1 登陆码云官网进行注册<br> <a target="_blank" rel="noopener" href="https://gitee.com/">https://gitee.com/</a></p>
<p>1.2 进行注册</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/479960dde05c3bc66d0a5528e3f79bd4.png" alt="1552218028455"><img src="" alt="点击并拖拽以移动"></p>
<h2 id="2-创建工程"><a href="#2-创建工程" class="headerlink" title="2. 创建工程"></a>2. 创建工程</h2><p>2.1 创建一个新工程</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/526e861724cb3a32ca441313915ab648.png" alt="1552218261402"><img src="" alt="点击并拖拽以移动"></p>
<p> 2.2 填写项目信息<br> ![新建仓库 - 码云 Gitee.com](<a target="_blank" rel="noopener" href="http://zi1.gitee.io/picture/tc/01/%E6%96%B0%E5%BB%BA%E4%BB%93%E5%BA%93">http://zi1.gitee.io/picture/tc/01/新建仓库</a> - 码云 Gitee.com.png)</p>
<h2 id="3-搭建你的项目"><a href="#3-搭建你的项目" class="headerlink" title="3. 搭建你的项目"></a>3. 搭建你的项目</h2><p>现在我们需要做的就是将刚才新建好的项目down下来</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/1d03ef07c323c30f270ea0b6fb33b35e.png" alt="1552218836155"><img src="" alt="点击并拖拽以移动"></p>
<p>拉取代码到本地(这是git的基本操作,如果会就直接跳过)</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/9cdda813d317732c6b247403e9ceec26.png" alt="1552218927183"><img src="" alt="点击并拖拽以移动"></p>
<p>复制图1 中的地址到地址栏点击确定</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/b9e24cb2c9d5d4d917ee02b7053814b2.png" alt="1552219032049"><img src="" alt="点击并拖拽以移动"></p>
<p>拉取下来后我们会看到这样的目录</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/510087a42cb80effcef92fb09938dffc.png" alt="1552219301186"><img src="" alt="点击并拖拽以移动"></p>
<p>现在我们在目录中建立一个文件夹如:picture ,并在其中随意放入一张图片</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/a1f00299fde5a7a618b0309589946976.png" alt="1552219370649"><img src="" alt="点击并拖拽以移动"></p>
<p>将新创建的文件纳入版本控制</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/1f91a014cbe951752cb139a7b5e41acb.png" alt="1552219496665"><img src="" alt="点击并拖拽以移动"></p>
<p>点击确定</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/6ff31da06e29490fe82d514e08c87e4b.png" alt="1552219669612"><img src="" alt="点击并拖拽以移动"></p>
<p>提交 </p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/aac56326f217143949fe2e22e57013ca.png" alt="1552219741583"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/ff03cf5420a8ccd2db1dcc142a8ff4b5.png" alt="1552219927659"><img src="" alt="点击并拖拽以移动"></p>
<p>提交到主分支上 </p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/8018832b97f7c75b57054eb0cc9cbad4.png" alt="1552219990875"><img src="" alt="点击并拖拽以移动"></p>
<p>再次推送 </p>
<p>注意:这里可能需要你输入gitee的账号密码 </p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/fdb7b66c379c06a1932e05ba100f150b.png" alt="1552220062502"><img src="" alt="点击并拖拽以移动"></p>
<p>当你看到这一步的时候就可以说是推送完成了 </p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/cc93fbcfc61d0429bb4d115839cdf165.png" alt="1552220125122"><img src="" alt="点击并拖拽以移动"></p>
<h2 id="4-启用gitpage服务"><a href="#4-启用gitpage服务" class="headerlink" title="4. 启用gitpage服务"></a>4. 启用gitpage服务</h2><p>这时我们再次打开我们的gitee项目,选择右侧的服务下Gitee Pages</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/8dc17ef2f4f397c68f9a21f18c9de2e8.png" alt="1552220406128"><img src="" alt="点击并拖拽以移动"></p>
<p>打开后我们点击启动</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/c01fc22e09efac55c0c18f7ac74a23f4.png" alt="1552220482860"><img src="" alt="点击并拖拽以移动"></p>
<p>当我们点击启动后,启动成功的画面如下,我们点击下面的这个地址</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/f3dc849ca537de7d493fef7de581b7b7.png" alt="1552220546003"><img src="" alt="点击并拖拽以移动"></p>
<p> 还记得我们当时创建的文件夹名字和图片名字吗?<br> 在项目名下加上文件夹(也就是路径)名字 再加上你的图片全面(加后缀)</p>
<p>我的路径是:</p>
<p><a target="_blank" rel="noopener" href="http://zi1.gitee.io/pic/picture/1.jpg">http://zi1.gitee.io/pic/picture/1.jpg</a></p>
<p>当做到这里你的图床路就搭建成功了!</p>
<p>此时你可以直接引用此路径,但稍微比较麻烦.</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/f051b79897563ac009915fdcd2d67cd8.png" alt="1552220978327"><img src="" alt="点击并拖拽以移动"></p>
<h2 id="5-修改引用路径"><a href="#5-修改引用路径" class="headerlink" title="5.修改引用路径"></a>5.修改引用路径</h2><p>如果你也是用Typora进行博客创作可以进行如下设置,可提高你的创作效率</p>
<p>将typora中图片保存设置为你的git存放图片的目录</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/3064a5710186b1535dfe218218f47665.png" alt="1552221315081"><img src="" alt="点击并拖拽以移动"><br> 那么此时,你的图片文件已经保存了一份在你的git本地,直接推送到远程仓库就可以了.操作与第三步一样,纳入版本控制后一顺推上去</p>
<p>推送完成后可以验证一下是否推送成功,在地址栏输入图片路径,进行验证</p>
<p>注意: 此时我们的图片引用的还是本地的路径,下面我们将图片改成gitee上的路径</p>
<p>我们将内容复制为markdown格式</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/eff6b32ee97cb09708de8036684042e9.png" alt="1552221852788"><img src="" alt="点击并拖拽以移动"></p>
<p> 我们将所有的内容黏贴到文本编辑器中,此处建议使用notepad++<br> 将所有的上斜线替换成下斜线</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/538d78efb9a6ea2e62456a5522c4b56b.png" alt="1552222076882"><img src="" alt="点击并拖拽以移动"></p>
<p> 替换成gitee的路径</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/3fd1139e0c5a5d265ac9807685954c0b.png" alt="1552222308503"><img src="" alt="点击并拖拽以移动"></p>
<p> 替换的时候我们只需要将本地路径替换成gitee路径即可.</p>
<p>验证我们的地址是否成功 – &gt; 将替换后的文本全选黏贴到一个新的markdown中,如果图片可以显示出来,说明没有问题</p>
<p>** 注意: 建议将全文写完后再进行路径的替换**</p>
<h2 id="6-修改gitee主页"><a href="#6-修改gitee主页" class="headerlink" title="6. 修改gitee主页"></a>6. 修改gitee主页</h2><p>有朋友看到第一眼觉得这个主页很丑,你可以替换成你喜欢的主页都可以.这里推荐一个地址:</p>
<p><a target="_blank" rel="noopener" href="http://www.cssmoban.com/">http://www.cssmoban.com/</a></p>
<p>下载自己喜欢的模板.</p>
<p>或者</p>
<p>打开你想要的页面,ctrl + s 保存网页(以百度主页为例<a target="_blank" rel="noopener" href="http://www.baidu.com/">www.baidu.com</a>)</p>
<p>你会得到这样两个文件</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/e3ae12de640dee296419a8571d5d94d7.png" alt="1552222739802"><img src="" alt="点击并拖拽以移动"></p>
<p>将html文件名修改为index.hmtl</p>
<p>然后将这两个文件放如你的本地工程中</p>
<p>纳入版本控制,一顺上推就ok了.</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/38691f97dd4c2ee7159d5cf92544d7b6.png" alt="1552222943754"><img src="" alt="点击并拖拽以移动"></p>
<p>在网上下载下来的模板也是一样的玩法.</p>
<h1 id="结合Picgo"><a href="#结合Picgo" class="headerlink" title="结合Picgo"></a>结合Picgo</h1><h3 id="创建私人令牌"><a href="#创建私人令牌" class="headerlink" title="创建私人令牌"></a>创建私人令牌</h3><p>点击头像 —&gt; 设置 —&gt; 私人令牌 —&gt; 新生成令牌</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/6b69ecab931d99396fb8052f6bca055f.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/24aa9e4289a13111a8427c6d1aa61cb2.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/d8ddd9ab79408ef0fb73834d5680c776.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p>点击提交，输入当前账号密码后，<strong>注意出现的令牌码一定要复制下来!!!</strong></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/cd8c3c0b34a3c49f7f90a6c0e4d05e05.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p>到这里gitee就OK了！！！</p>
<h3 id="安装picGo插件"><a href="#安装picGo插件" class="headerlink" title="安装picGo插件"></a>安装picGo插件</h3><p><img src="https://img-blog.csdnimg.cn/img_convert/eea8f9c793aa9dd95efa41db25c925d2.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/facdd8e911295e4a612eec06e5d762fa.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><strong>【注】如果没有Node.js就要先安装完Node.js，然后退掉PicGo再重新安装一次插件</strong></p>
<h3 id="图床设置"><a href="#图床设置" class="headerlink" title="图床设置"></a>图床设置</h3><p><img src="https://img-blog.csdnimg.cn/img_convert/7f9ed16528f071834a9c2004500dbae4.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p>找到刚刚安装好的gitee</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/d9f6352e72e719021f9ed25e5fd1893f.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/5353429cd1b227a2a9c191dffb050fa2.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><strong>友情提示</strong></p>
<p>厂库地址：</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/ae9c562de7ce4742f93dfef7c6da08ca.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p>私人令牌：如果没有复制的话，那就重新创建一个在复制。</p>
<h3 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h3><p><img src="https://img-blog.csdnimg.cn/img_convert/a0c019af48d7378130855a31bb629e7d.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/de82fbee26f1e7b300231acdab59e018.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<h2 id="picGo配合Typora使用"><a href="#picGo配合Typora使用" class="headerlink" title="picGo配合Typora使用"></a>picGo配合Typora使用</h2><h3 id="配置Typora"><a href="#配置Typora" class="headerlink" title="配置Typora"></a>配置Typora</h3><p>Typora进入偏好设置</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/edbbd0e0ea80b25ca25774370f9e7c39.png" alt="image-20210329153404402"><img src="" alt="点击并拖拽以移动"></p>
<p>点击图像，进行如下配置</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/794304a822cbb402c7ffe96642fdcbf6.png" alt="image-20210329153640783"><img src="" alt="点击并拖拽以移动"></p>
<h3 id="错误解决"><a href="#错误解决" class="headerlink" title="错误解决"></a>错误解决</h3><p>配置完成后点击<code>验证图片上传选项</code></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/3cf6daca00a5d0d476331c16a4819192.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p>发生错误，提示<code>Failed to fetch</code></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/6cd26352ed4c56b7d6bbda4dc1dcbb73.png" alt="img"><img src="" alt="点击并拖拽以移动"></p>
<p><strong>解决方案</strong></p>
<p>获取失败的原因：找不到路径。这里发现Typora的请求路径的端口是36677，而PicGo的端口是36679，所以会找不到路径。</p>
<p>解决：把PicGo的端口改成36677。</p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/5d64a0265168572d60d674201792db01.png" alt="image-20210329155536887"><img src="" alt="点击并拖拽以移动"></p>
<p><img src="https://img-blog.csdnimg.cn/img_convert/3a85096a1514b4df86796ff6c09182ba.png" alt="image-20210329155606051"><img src="" alt="点击并拖拽以移动"></p>
<h1 id="其他图床工具"><a href="#其他图床工具" class="headerlink" title="其他图床工具"></a>其他图床工具</h1><p><a target="_blank" rel="noopener" href="https://github.com/zzzzbw/gitpic">https://github.com/zzzzbw/gitpic</a></p>
<p><a target="_blank" rel="noopener" href="https://github.com/xiebruce/PicUploader">https://github.com/xiebruce/PicUploader</a></p>
<p>参考：</p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/u010654995/article/details/88383995">https://blog.csdn.net/u010654995/article/details/88383995</a></p>
<p><a target="_blank" rel="noopener" href="https://gitee.com/ningboyun/PicGo_img?_from=gitee_search">https://gitee.com/ningboyun/PicGo_img?_from=gitee_searc</a></p>
 
      <!-- reward -->
      
      <div id="reword-out">
        <div id="reward-btn">
          打赏
        </div>
      </div>
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>版权声明： </strong>
          
          本博客所有文章除特别声明外，著作权归作者所有。转载请注明出处！
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://example.com/2021/06/18/blog/%E4%BD%BF%E7%94%A8gitee%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%9B%BE%E5%BA%8A/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/blog/" rel="tag">blog</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2021/06/20/framework/Docker%E5%9F%BA%E6%9C%AC%E5%91%BD%E4%BB%A4/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            Docker基本命令
          
        </div>
      </a>
    
    
      <a href="/2021/06/17/Mysql/Mybatis%E8%87%AA%E5%AE%9A%E4%B9%89resultMap/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">Mybatis自定义resultMap</div>
      </a>
    
  </nav>

   
<!-- valine评论 -->
<div id="vcomments-box">
  <div id="vcomments"></div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script>
  new Valine({
    el: "#vcomments",
    app_id: "",
    app_key: "",
    path: window.location.pathname,
    avatar: "monsterid",
    placeholder: "给我的文章加点评论吧~",
    recordIP: true,
  });
  const infoEle = document.querySelector("#vcomments .info");
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
    infoEle.childNodes.forEach(function (item) {
      item.parentNode.removeChild(item);
    });
  }
</script>
<style>
  #vcomments-box {
    padding: 5px 30px;
  }

  @media screen and (max-width: 800px) {
    #vcomments-box {
      padding: 5px 0px;
    }
  }

  #vcomments-box #vcomments {
    background-color: #fff;
  }

  .v .vlist .vcard .vh {
    padding-right: 20px;
  }

  .v .vlist .vcard {
    padding-left: 10px;
  }
</style>

 
   
     
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2021
        <i class="ri-heart-fill heart_icon"></i> Chenyy
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>访问人数:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>浏览次数:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="ChenyyのBlog"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">文章</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/book">收藏</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about/me">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="搜索">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    
  </div>
</div>
    
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->


<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->


<link rel="stylesheet" href="/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>


<!-- CanvasBackground -->


    
  </div>
</body>

</html>